<template>
  <el-container class="bg-gray h-100 w-100">
    <el-main class="p-0">
      <transition name="fade-transform" mode="out-in">
        <router-view />
      </transition>
    </el-main>
  </el-container>
</template>
<script>
export default {
  name: "workunit",
  title: "作业单位",
  data() {
    return {};
  },
  mounted () {
    this.redirect()
  },
  methods: {
    redirect () {
      let type = this.$store.getters.userType
      if (type === 1) {
        this.$router.push({name: 'workprovince'})
      } else if (type === 3) {
        this.$router.push({name: 'workcity'})
      } else {
        this.$router.push({name: 'workcountry'})
      }
    }
  },
  watch: {
    '$route' (val) {
      if (val.name === 'workunit') {
        this.redirect()
      }
    }
  }
};
</script>
<style lang='scss'>
</style>